#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
typedef char Datatype;
typedef struct stack
{
	Datatype* arr;
	int size;
	int capacity;
}Stack;
void pushStack(Stack* s,Datatype x)
{
	if (s->capacity == s->size)
	{
		s->capacity = s->capacity == 0 ? 4 : 2 * s->capacity;
		s->arr = (Datatype*)realloc(s->arr,sizeof(Datatype) * s->capacity);
	}
	s->arr[s->size] = x;
	s->size++;
}
Datatype PushStack(Stack* s)
{
	Datatype x = s->arr[s->size - 1];
	s->size--;
	return x;
}
int main()
{
	Stack s;
	s.arr = NULL;
	s.capacity = 0;
	s.size = 0;
	Datatype arr1[10000] = { 0 };
    gets(arr1);
	int x = 0;
	int count = 0;
	while (arr1[x]!='@')
	{
		count++;
		pushStack(&s, arr1[x]);
		x++;
	}
	int size = (count - 1) / 2;
	int flag = 1;
	x = 0;
	if (count % 2 == 0||count<=2)
		flag = 0;
	else 
	{
		while (size--)
		{
			Datatype a = PushStack(&s);
			if (a != arr1[x])
			{
				flag = 0;
				break;
			}
			x++;
		}
	}
	if (s.arr[(count - 1) / 2 ] != '&')
		flag = 0;
	if (flag)
		printf("%d", (count - 1) / 2);
	else
		printf("no");
}